package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "aead_wrapper",
    srcs = ["aead_wrapper.cc"],
    hdrs = ["aead_wrapper.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:aead",
        "//:crypto_format",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//internal:monitoring_util",
        "//internal:registry_impl",
        "//internal:util",
        "//monitoring",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "cord_aead_wrapper",
    srcs = ["cord_aead_wrapper.cc"],
    hdrs = ["cord_aead_wrapper.h"],
    include_prefix = "tink/aead",
    deps = [
        ":cord_aead",
        "//:crypto_format",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:cord",
    ],
)

cc_library(
    name = "cord_aead",
    hdrs = ["cord_aead.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//util:statusor",
        "@com_google_absl//absl/strings:cord",
    ],
)

cc_library(
    name = "aead_config",
    srcs = ["aead_config.cc"],
    hdrs = ["aead_config.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        ":aead_wrapper",
        ":aes_ctr_hmac_aead_key_manager",
        ":aes_ctr_hmac_aead_proto_serialization",
        ":aes_eax_key_manager",
        ":aes_eax_proto_serialization",
        ":aes_gcm_key_manager",
        ":aes_gcm_proto_serialization",
        ":aes_gcm_siv_key_manager",
        ":aes_gcm_siv_proto_serialization",
        ":kms_aead_key_manager",
        ":kms_envelope_aead_key_manager",
        ":xchacha20_poly1305_key_manager",
        ":xchacha20_poly1305_proto_serialization",
        "//:registry",
        "//config:tink_fips",
        "//mac:mac_config",
        "//proto:config_cc_proto",
        "//util:status",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "aead_factory",
    srcs = ["aead_factory.cc"],
    hdrs = ["aead_factory.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_wrapper",
        "//:aead",
        "//:key_manager",
        "//:keyset_handle",
        "//:registry",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "aead_key_templates",
    srcs = ["aead_key_templates.cc"],
    hdrs = ["aead_key_templates.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:aes_eax_cc_proto",
        "//proto:aes_gcm_cc_proto",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:kms_envelope_cc_proto",
        "//proto:tink_cc_proto",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_eax_key_manager",
    hdrs = ["aes_eax_key_manager.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//proto:aes_eax_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aes_eax_boringssl",
        "//subtle:random",
        "//util:constants",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_gcm_key_manager",
    hdrs = ["aes_gcm_key_manager.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        ":cord_aead",
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:input_stream",
        "//aead/internal:cord_aes_gcm_boringssl",
        "//internal:fips_utils",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aes_gcm_boringssl",
        "//subtle:random",
        "//util:constants",
        "//util:input_stream_util",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_gcm_siv_key_manager",
    hdrs = ["aes_gcm_siv_key_manager.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aes_gcm_siv_boringssl",
        "//subtle:random",
        "//util:constants",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_ctr_hmac_aead_key_manager",
    srcs = ["aes_ctr_hmac_aead_key_manager.cc"],
    hdrs = ["aes_ctr_hmac_aead_key_manager.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:input_stream",
        "//:mac",
        "//internal:fips_utils",
        "//mac:hmac_key_manager",
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aes_ctr_boringssl",
        "//subtle:encrypt_then_authenticate",
        "//subtle:ind_cpa_cipher",
        "//subtle:random",
        "//util:constants",
        "//util:enums",
        "//util:input_stream_util",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "xchacha20_poly1305_key_manager",
    hdrs = ["xchacha20_poly1305_key_manager.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:input_stream",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//subtle",
        "//subtle:xchacha20_poly1305_boringssl",
        "//util:constants",
        "//util:input_stream_util",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "kms_aead_key_manager",
    hdrs = ["kms_aead_key_manager.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:kms_client",
        "//:kms_clients",
        "//proto:kms_aead_cc_proto",
        "//proto:tink_cc_proto",
        "//util:constants",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "kms_envelope_aead",
    srcs = ["kms_envelope_aead.cc"],
    hdrs = ["kms_envelope_aead.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//:aead",
        "//:registry",
        "//aead/internal:aead_util",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:endian",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "kms_envelope_aead_key_manager",
    srcs = ["kms_envelope_aead_key_manager.cc"],
    hdrs = ["kms_envelope_aead_key_manager.h"],
    include_prefix = "tink/aead",
    deps = [
        ":kms_envelope_aead",
        "//:aead",
        "//:core/key_type_manager",
        "//:core/template_util",
        "//:kms_client",
        "//:kms_clients",
        "//aead/internal:aead_util",
        "//internal:fips_utils",
        "//proto:kms_envelope_cc_proto",
        "//proto:tink_cc_proto",
        "//util:constants",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "mock_aead",
    testonly = 1,
    hdrs = ["mock_aead.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//:aead",
        "//util:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest",
    ],
)

cc_library(
    name = "failing_aead",
    testonly = 1,
    srcs = ["failing_aead.cc"],
    hdrs = ["failing_aead.h"],
    include_prefix = "tink/aead",
    visibility = ["//visibility:public"],
    deps = [
        "//:aead",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aead_parameters",
    hdrs = ["aead_parameters.h"],
    include_prefix = "tink/aead",
    deps = ["//:parameters"],
)

cc_library(
    name = "aead_key",
    hdrs = ["aead_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:key",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_gcm_parameters",
    srcs = ["aes_gcm_parameters.cc"],
    hdrs = ["aes_gcm_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_gcm_key",
    srcs = ["aes_gcm_key.cc"],
    hdrs = ["aes_gcm_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":aes_gcm_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_gcm_proto_serialization",
    srcs = ["aes_gcm_proto_serialization.cc"],
    hdrs = ["aes_gcm_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aes_gcm_key",
        ":aes_gcm_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//util:secret_data",
        "//util:secret_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_gcm_siv_parameters",
    srcs = ["aes_gcm_siv_parameters.cc"],
    hdrs = ["aes_gcm_siv_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "aes_gcm_siv_key",
    srcs = ["aes_gcm_siv_key.cc"],
    hdrs = ["aes_gcm_siv_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":aes_gcm_siv_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_gcm_siv_proto_serialization",
    srcs = ["aes_gcm_siv_proto_serialization.cc"],
    hdrs = ["aes_gcm_siv_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aes_gcm_siv_key",
        ":aes_gcm_siv_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "config_v0",
    srcs = ["config_v0.cc"],
    hdrs = ["config_v0.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:configuration",
        "//aead/internal:config_v0",
        "@com_google_absl//absl/log:check",
    ],
)

cc_library(
    name = "key_gen_config_v0",
    srcs = ["key_gen_config_v0.cc"],
    hdrs = ["key_gen_config_v0.h"],
    include_prefix = "tink/aead",
    deps = [
        "//:key_gen_configuration",
        "//aead/internal:key_gen_config_v0",
        "@com_google_absl//absl/log:check",
    ],
)

cc_library(
    name = "aes_eax_parameters",
    srcs = ["aes_eax_parameters.cc"],
    hdrs = ["aes_eax_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_eax_key",
    srcs = ["aes_eax_key.cc"],
    hdrs = ["aes_eax_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":aes_eax_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_eax_proto_serialization",
    srcs = ["aes_eax_proto_serialization.cc"],
    hdrs = ["aes_eax_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aes_eax_key",
        ":aes_eax_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:aes_eax_cc_proto",
        "//proto:tink_cc_proto",
        "//util:secret_data",
        "//util:secret_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "xchacha20_poly1305_parameters",
    srcs = ["xchacha20_poly1305_parameters.cc"],
    hdrs = ["xchacha20_poly1305_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "xchacha20_poly1305_key",
    srcs = ["xchacha20_poly1305_key.cc"],
    hdrs = ["xchacha20_poly1305_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":xchacha20_poly1305_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "xchacha20_poly1305_proto_serialization",
    srcs = ["xchacha20_poly1305_proto_serialization.cc"],
    hdrs = ["xchacha20_poly1305_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":xchacha20_poly1305_key",
        ":xchacha20_poly1305_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "chacha20_poly1305_parameters",
    srcs = ["chacha20_poly1305_parameters.cc"],
    hdrs = ["chacha20_poly1305_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
    ],
)

cc_library(
    name = "chacha20_poly1305_key",
    srcs = ["chacha20_poly1305_key.cc"],
    hdrs = ["chacha20_poly1305_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":chacha20_poly1305_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "chacha20_poly1305_proto_serialization",
    srcs = ["chacha20_poly1305_proto_serialization.cc"],
    hdrs = ["chacha20_poly1305_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":chacha20_poly1305_key",
        ":chacha20_poly1305_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:chacha20_poly1305_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_ctr_hmac_aead_parameters",
    srcs = ["aes_ctr_hmac_aead_parameters.cc"],
    hdrs = ["aes_ctr_hmac_aead_parameters.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_parameters",
        "//:parameters",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_ctr_hmac_aead_key",
    srcs = ["aes_ctr_hmac_aead_key.cc"],
    hdrs = ["aes_ctr_hmac_aead_key.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aead_key",
        ":aes_ctr_hmac_aead_parameters",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "aes_ctr_hmac_aead_proto_serialization",
    srcs = ["aes_ctr_hmac_aead_proto_serialization.cc"],
    hdrs = ["aes_ctr_hmac_aead_proto_serialization.h"],
    include_prefix = "tink/aead",
    deps = [
        ":aes_ctr_hmac_aead_key",
        ":aes_ctr_hmac_aead_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//util:secret_data",
        "//util:secret_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

# tests

cc_test(
    name = "aead_wrapper_test",
    size = "small",
    srcs = ["aead_wrapper_test.cc"],
    deps = [
        ":aead_wrapper",
        ":mock_aead",
        "//:aead",
        "//:crypto_format",
        "//:primitive_set",
        "//:registry",
        "//internal:registry_impl",
        "//monitoring",
        "//monitoring:monitoring_client_mocks",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aead_config_test",
    size = "small",
    srcs = ["aead_config_test.cc"],
    tags = ["fips"],
    deps = [
        ":aead_config",
        ":aead_key_templates",
        ":aes_ctr_hmac_aead_key",
        ":aes_ctr_hmac_aead_parameters",
        ":aes_eax_key",
        ":aes_eax_parameters",
        ":aes_gcm_key",
        ":aes_gcm_key_manager",
        ":aes_gcm_parameters",
        ":aes_gcm_siv_key",
        ":aes_gcm_siv_parameters",
        ":key_gen_config_v0",
        ":xchacha20_poly1305_key",
        ":xchacha20_poly1305_parameters",
        "//:aead",
        "//:insecure_secret_key_access",
        "//:key",
        "//:key_status",
        "//:keyset_handle",
        "//:keyset_handle_builder",
        "//:parameters",
        "//:partial_key_access",
        "//:registry",
        "//:restricted_data",
        "//config:global_registry",
        "//config:tink_fips",
        "//internal:fips_utils",
        "//internal:legacy_proto_key",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:aes_eax_cc_proto",
        "//proto:aes_gcm_cc_proto",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aead_factory_test",
    size = "small",
    srcs = ["aead_factory_test.cc"],
    deps = [
        ":aead_config",
        ":aead_factory",
        ":aes_gcm_key_manager",
        "//:aead",
        "//:crypto_format",
        "//:keyset_handle",
        "//internal:key_info",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_keyset_handle",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aead_key_templates_test",
    size = "small",
    srcs = ["aead_key_templates_test.cc"],
    deps = [
        ":aead_config",
        ":aead_key_templates",
        ":aes_ctr_hmac_aead_key_manager",
        ":aes_eax_key_manager",
        ":aes_gcm_key_manager",
        ":aes_gcm_siv_key_manager",
        ":kms_envelope_aead_key_manager",
        ":xchacha20_poly1305_key_manager",
        "//:aead",
        "//:core/key_manager_impl",
        "//:key_manager",
        "//:keyset_handle",
        "//config:global_registry",
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:aes_eax_cc_proto",
        "//proto:aes_gcm_cc_proto",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:kms_envelope_cc_proto",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//subtle:aead_test_util",
        "//util:fake_kms_client",
        "//util:status",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_eax_key_manager_test",
    size = "small",
    srcs = ["aes_eax_key_manager_test.cc"],
    deps = [
        ":aes_eax_key_manager",
        "//:aead",
        "//proto:aes_eax_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aead_test_util",
        "//subtle:aes_eax_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_key_manager_test",
    size = "small",
    srcs = ["aes_gcm_key_manager_test.cc"],
    deps = [
        ":aes_gcm_key_manager",
        ":cord_aead",
        "//:aead",
        "//aead/internal:cord_aes_gcm_boringssl",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aead_test_util",
        "//subtle:aes_gcm_boringssl",
        "//util:istream_input_stream",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_siv_key_manager_test",
    size = "small",
    srcs = ["aes_gcm_siv_key_manager_test.cc"],
    deps = [
        ":aes_gcm_siv_key_manager",
        "//:aead",
        "//internal:ssl_util",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aead_test_util",
        "//subtle:aes_gcm_siv_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_ctr_hmac_aead_key_manager_test",
    size = "small",
    srcs = ["aes_ctr_hmac_aead_key_manager_test.cc"],
    deps = [
        ":aes_ctr_hmac_aead_key_manager",
        "//:aead",
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle",
        "//subtle:aead_test_util",
        "//subtle:aes_ctr_boringssl",
        "//util:enums",
        "//util:istream_input_stream",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "xchacha20_poly1305_key_manager_test",
    size = "small",
    srcs = ["xchacha20_poly1305_key_manager_test.cc"],
    deps = [
        ":xchacha20_poly1305_key_manager",
        "//:aead",
        "//internal:ssl_util",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//subtle:aead_test_util",
        "//subtle:xchacha20_poly1305_boringssl",
        "//util:istream_input_stream",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "kms_aead_key_manager_test",
    size = "small",
    srcs = ["kms_aead_key_manager_test.cc"],
    deps = [
        ":kms_aead_key_manager",
        "//:aead",
        "//:kms_client",
        "//:kms_clients",
        "//proto:kms_aead_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aead_test_util",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "kms_envelope_aead_test",
    size = "small",
    srcs = ["kms_envelope_aead_test.cc"],
    deps = [
        ":aead_config",
        ":aead_key_templates",
        ":kms_envelope_aead",
        "//:aead",
        "//:keyset_handle",
        "//:registry",
        "//config:global_registry",
        "//internal:ssl_util",
        "//mac:mac_key_templates",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//util:fake_kms_client",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/base:endian",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "kms_envelope_aead_key_manager_test",
    size = "small",
    srcs = ["kms_envelope_aead_key_manager_test.cc"],
    deps = [
        ":aead_config",
        ":aead_key_templates",
        ":aes_eax_key_manager",
        ":kms_envelope_aead",
        ":kms_envelope_aead_key_manager",
        "//:aead",
        "//:keyset_handle",
        "//:kms_client",
        "//:kms_clients",
        "//:registry",
        "//config:global_registry",
        "//mac:mac_key_templates",
        "//proto:kms_envelope_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:aead_test_util",
        "//util:fake_kms_client",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "cord_aead_wrapper_test",
    size = "small",
    srcs = ["cord_aead_wrapper_test.cc"],
    deps = [
        ":cord_aead",
        ":cord_aead_wrapper",
        "//:primitive_set",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:cord",
        "@com_google_absl//absl/strings:cord_test_helpers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "failing_aead_test",
    srcs = ["failing_aead_test.cc"],
    deps = [
        ":failing_aead",
        "//:aead",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_parameters_test",
    srcs = ["aes_gcm_parameters_test.cc"],
    deps = [
        ":aes_gcm_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_key_test",
    srcs = ["aes_gcm_key_test.cc"],
    deps = [
        ":aes_gcm_key",
        ":aes_gcm_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_proto_serialization_test",
    size = "small",
    srcs = ["aes_gcm_proto_serialization_test.cc"],
    deps = [
        ":aes_gcm_key",
        ":aes_gcm_parameters",
        ":aes_gcm_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:aes_gcm_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_siv_parameters_test",
    srcs = ["aes_gcm_siv_parameters_test.cc"],
    deps = [
        ":aes_gcm_siv_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_siv_key_test",
    srcs = ["aes_gcm_siv_key_test.cc"],
    deps = [
        ":aes_gcm_siv_key",
        ":aes_gcm_siv_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_gcm_siv_proto_serialization_test",
    size = "small",
    srcs = ["aes_gcm_siv_proto_serialization_test.cc"],
    deps = [
        ":aes_gcm_siv_key",
        ":aes_gcm_siv_parameters",
        ":aes_gcm_siv_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:aes_gcm_siv_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "config_v0_test",
    srcs = ["config_v0_test.cc"],
    deps = [
        ":aead_key_templates",
        ":config_v0",
        ":key_gen_config_v0",
        "//:aead",
        "//:keyset_handle",
        "//internal:ssl_util",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_eax_parameters_test",
    srcs = ["aes_eax_parameters_test.cc"],
    deps = [
        ":aes_eax_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_eax_key_test",
    srcs = ["aes_eax_key_test.cc"],
    deps = [
        ":aes_eax_key",
        ":aes_eax_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_eax_proto_serialization_test",
    srcs = ["aes_eax_proto_serialization_test.cc"],
    deps = [
        ":aes_eax_key",
        ":aes_eax_parameters",
        ":aes_eax_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:aes_eax_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "xchacha20_poly1305_parameters_test",
    srcs = ["xchacha20_poly1305_parameters_test.cc"],
    deps = [
        ":xchacha20_poly1305_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "xchacha20_poly1305_key_test",
    srcs = ["xchacha20_poly1305_key_test.cc"],
    deps = [
        ":xchacha20_poly1305_key",
        ":xchacha20_poly1305_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "xchacha20_poly1305_proto_serialization_test",
    srcs = ["xchacha20_poly1305_proto_serialization_test.cc"],
    deps = [
        ":xchacha20_poly1305_key",
        ":xchacha20_poly1305_parameters",
        ":xchacha20_poly1305_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:tink_cc_proto",
        "//proto:xchacha20_poly1305_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "chacha20_poly1305_parameters_test",
    srcs = ["chacha20_poly1305_parameters_test.cc"],
    deps = [
        ":chacha20_poly1305_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "chacha20_poly1305_key_test",
    srcs = ["chacha20_poly1305_key_test.cc"],
    deps = [
        ":chacha20_poly1305_key",
        ":chacha20_poly1305_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "chacha20_poly1305_proto_serialization_test",
    srcs = ["chacha20_poly1305_proto_serialization_test.cc"],
    deps = [
        ":chacha20_poly1305_key",
        ":chacha20_poly1305_parameters",
        ":chacha20_poly1305_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:chacha20_poly1305_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_ctr_hmac_aead_parameters_test",
    srcs = ["aes_ctr_hmac_aead_parameters_test.cc"],
    deps = [
        ":aes_ctr_hmac_aead_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_ctr_hmac_aead_key_test",
    srcs = ["aes_ctr_hmac_aead_key_test.cc"],
    deps = [
        ":aes_ctr_hmac_aead_key",
        ":aes_ctr_hmac_aead_parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "aes_ctr_hmac_aead_proto_serialization_test",
    srcs = ["aes_ctr_hmac_aead_proto_serialization_test.cc"],
    deps = [
        ":aes_ctr_hmac_aead_key",
        ":aes_ctr_hmac_aead_parameters",
        ":aes_ctr_hmac_aead_proto_serialization",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:aes_ctr_cc_proto",
        "//proto:aes_ctr_hmac_aead_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)
